import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/Login.vue'),
    },
    {
      path: '/main',
      name: 'main',
      component: () => import('../views/Main.vue'),
      children: [
        {
          path: '/log',
          name: 'log',
          component: () => import('../views/BasicData/Log.vue'),
        }, {
          path: '/adminsetting',
          name: 'adminsetting',
          component: () => import('../views/BasicData/AdminSetting.vue'),
        }, {
          path: '/gridPersion',
          name: 'gridPersion',
          component: () => import('../views/BasicData/GridPerson.vue'),
        }, {
          path: '/gridType',
          name: 'gridType',
          component: () => import('../views/BasicData/GridType.vue'),
        }, {
          path: '/stepOne',
          name: 'stepOne',
          component: () => import('../views/GridManage/StepOne.vue'),
        }, {
          path: '/stepTwo',
          name: 'stepTwo',
          component: () => import('../views/GridManage/StepTwo.vue'),
        }, {
          path: '/stepThree',
          name: 'stepThree',
          component: () => import('../views/GridManage/StepThree.vue'),
        }, {
          path: '/stepFour',
          name: 'stepFour',
          component: () => import('../views/GridManage/StepFour.vue'),
        }, {
          path: '/stepFive',
          name: 'stepFive',
          component: () => import('../views/GridManage/StepFive.vue'),
        }, {
          path: '/physical',
          name: 'physical',
          component: () => import('../views/GridManage/PhsicalGrid.vue'),
        }, {
          path: '/CascaderAndTree',
          name: 'CascaderAndTree',
          component: () => import('../views/GridManage/CascaderAndTree.vue'),
        }, {
          path: '/LogicalGrid',
          name: 'LogicalGrid',
          component: () => import('../views/GridManage/LogicalGrid.vue'),
        }, {
          path: '/Duty',
          name: 'Duty',
          component: () => import('../views/GridManage/Duty.vue'),
        }, {
          path: '/team',
          name: 'team',
          component: () => import('../views/GridManage/Team.vue'),
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
  ],
})

export default router
